@extends('home.enterprises.layout')
@section('content')
<div class="daohang_3">
	<a href="{{ url('/home/enterprise/myjobs') }}/{{ $id }}?token={{ session('master['.$id.']') -> token }}" target="_self" class="btnpub"></a>
</div>
<div class="ip_order">
	<table width="100%" cellspacing="0" cellpadding="0">
		<tbody><tr>
			<th>职位名称</th>
			<th>职位状态</th>
			<th>&nbsp;简历数</th>
			<th>工作地点</th>
			<th>发布日期</th>
			<th>截止日期</th>
			<th>操作</th>
			<th>推广</th>
		</tr>
		@foreach($data as $k => $v)
		<tr>
			<td class="title" style='background:000;font-weight:100;'>
				<div title="{{ $v -> workname }}">
				{{  mb_substr($v -> workname,0,7) }}
				...
					
				</div>
			</td>
			<td>
				@if($v -> status == 1)
				已发布
				@elseif($v -> sale == 1)
				待审核
				@else
				待发布 
				@endif
			</td>
			 <!-- 
			<td>
				 - 
			</td>-->
			
			
			<td class="resumeCount" id="resumeCount_null" positionnumber="null">
			
				<a id="resumeCount_href_{{ $v -> id }}" class="__ga__my_orders_001" href="{{ url('/home/enterprise/resumes') }}/{{ $id }}?token={{ session('master['.$id.']') -> token }}">
					{{ $resume[$k] }}</a>
			</td>
			
			
			
			<td class="td_place">{{ $v -> name }}</td>
			
			<td>{{ date('Y-m-d',$v -> date) }}</td>
			
			<td>{{ date('Y-m-d',$v -> date + 30 * 24 * 3600) }}</td>
			<td>
				 <a href="{{ url('/home/enterprise/jobs/view') }}/{{ $id }}/{{ $v -> id }}?token={{ session('master['.$id.']') -> token }}" target="_blank">预览</a>
				 /<a href="{{ url('/home/enterprise/jobs/modify') }}/{{ $id }}/{{ $v -> id }}?token={{ session('master['.$id.']') -> token }}">修改</a>   /<a href="javascript:void(0)" onclick="return payJob({{ $v -> id }})">发布</a>  /<a href="javascript:void(0);" onclick="return del('{{ $v -> id }}'); " target="_self">删除</a> 
			</td>
			<td>
				
			</td>
		</tr>
		@endforeach
		
		
	</tbody></table>
	<div class="pageNum">
		<div class="num2">
			{{-- !! $data -> appends($request) -> render() !! --}}
			<span><a href="{{ url('/home/enterprise/jobs/index') }}/{{ $id }}?token={{ session('master['.$id.']') -> token }}&page=1">首页</a> </span>
			<span> <a href="{{ url('/home/enterprise/jobs/index') }}/{{ $id }}?token={{ session('master['.$id.']') -> token }}&page={{ $data -> lastPage() }}">尾页</a></span>
		</div>
		<div class="num1">
			<form action="{{ url('/home/enterprise/jobs/index') }}/{{ $id }}" method="get">
			 <input name = "token" value="{{ session('master['.$id.']') -> token }}" type="hidden">
				第{{ empty($request['page'])?1:$request['page'] }}/{{ $data -> lastPage() }}页，去 <input name="page" class="inputText" type="text" value="{{ empty($request['page'])?1:$request['page'] }}"> 页 <input name="" src="/images/pagenum_bn.gif" title="GO" alt="GO" width="21" type="image" height="16">
			</form>
		</div>
		<div class="num3">
			<span>共<b>{{ count($data) }}</b>条信息
			</span>
		</div>
	</div>
</div>
<form action="{{ url('/home/enterprise/jobs/del') }}/{{ $id }}?token={{ session('master['.$id.']') -> token }}" method='post' id='recform'>
	{{ csrf_field() }}
	<input type="hidden" name='id' value="{{ $id }}">
	<input type="hidden" name='rec_id' id='rec'>
	
</form>
<form id='recpay'>
	<input type="hidden" name='token' value="{{ session('master['.$id.']') -> token }}">
</form>
<script>
	function del()
	{
		// alert(arguments[0]);
		$('#rec').val(arguments[0]);
		$('#recform').submit();
	}
	function payJob()
	{
		// alert(arguments[0]);
		// $('#rec').val(arguments[0]);
		$('#recpay').attr('action',"{{ url('/home/enterprise/jobs/pay') }}/{{ $id }}/"+arguments[0]);
		$('#recpay').attr('method',"get");
		// alert($('#recform').attr('action'));
		$('#recpay').submit();
	}
</script>
@endsection